package com.xing.controller;

import com.xing.Utils.Result;
import com.xing.dto.LiveIdentityAuthenticationDTO;
import com.xing.entity.LiveIdentityAuthenticationEntity;
import com.xing.service.LiveIdentityAuthenticationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "身份认证管理")
@RestController
@RequestMapping(value = "/identityAuthentication")
public class LiveIdentityAuthenticationController {

    @Autowired
    private LiveIdentityAuthenticationService identityAuthenticationService;


    @Operation(summary = "获取认证信息")
    @GetMapping(value = "/getById")
    @PreAuthorize("hasAnyAuthority('admin','role','user')")
    public Result getById(@RequestParam Long id) {
        LiveIdentityAuthenticationDTO liveIdentityAuthenticationDTO = identityAuthenticationService.getAuthenticationById(id);
        return new Result().ok(liveIdentityAuthenticationDTO);
    }


}
